<?php include_once("db_config.php");?>
<!DOCTYPE>
<html lang="<?php echo $lang;?>">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="renderer" content="webkit">
        <meta name="description" content="向日葵后台管理">
        <meta name="keywords" content="向日葵电脑">
        <meta name="author" content="ysfl">
        <meta name="robots" content="index,follow">
        <link rel="icon" href="img/favicon.ico">
        <title>向日葵电脑后台管理登录页面</title>
        <!--[if lte IE 8]>
        <style type="text/css">
            html,body{width:100%; height:100%; overflow:scroll}
            .section-btn{display:none;}
        </style>
        <![endif]-->
        <!-- Bootstrap core CSS -->
        <script src="js/jquery.min.js"></script>
        <script src="js/jquery.function.js"></script>
        <link href="./css/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">
        .main{
            width: 840px;
            height: 360px;
            border: 1px solid rgba(71, 173, 153, 0.25);
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
            margin: 10% auto;
            color: #FFFFFF;
        }
        .login_form{
            margin: 0 auto;
            padding: 8% 0 0 14%;
        }
        .login_form .input-group{
            margin-left: 30px;
        }
        .input-group-addon{
            color: rgb(5, 139, 150);
        }
        .userinfo{
            float: right;
              margin: -60 1 0 0;
        }
        .logoutinfo{
            float: right;
              margin: -100 1 0 0;
        }
        .login_err{
            margin:30px auto ;
            width: 50%;
            text-align: center;
        }
        body{
            background: url("./img/bg3.jpg") fixed center center no-repeat;
            background-size: cover;
            width: 100%;
        }
        h1{
            color:rgba(224, 236, 193, 0.79);
        }
        h1 small{
            color:rgba(0, 245, 255, 0.79);
        }
        </style>
    </head>
<body>
    <div class="main">
    <div class="page-header">
    <?php 
        session_start();
        if(!isset($_SESSION["userid"])){
        echo '
        <h1>Hello Boy! <small>Welcome to sun</small></h1>
    </div>
    <div id="login-info">

            <div class="alert alert-info login_err" role="alert">你还没有登陆！<a href="login.php" class="btn btn-primary btn-xs">点击登陆</a></div>
            ';}
        else {
            echo '
            <h1>尊敬的<b style="color:rgb(0, 255, 197);"> '.$_SESSION["username"].' </b>欢迎回来！<small>信息监控页面</small></h1>
    </div>
    <div id="login-info">
            <div class="navbar-form loginfo">
                <p class="userinfo">您当前的级别为：<span style="color:rgb(6, 245, 0);">'. $_SESSION["level"].'</span></p>
                <p class="logoutinfo"><a href="./admin/" class="btn btn-primary btn-xs">进入后台</a> <a id="logout" href="#" class="btn btn-danger btn-xs">退出登陆</a></p>
            </div>
            <div class="queryinfo">
                <p class="col-md-4"><span class="glyphicon glyphicon-th-list" style="color:orange;" aria-hidden="true"></span> 未完成任务:<strong class="num" style="color:orange;"> '; echo num('query','start','0'); echo ' </strong>个</p>
                <p class="col-md-4"><span class="glyphicon glyphicon-ok-sign" style="color:green;" aria-hidden="true"></span> 已完成任务: <strong class="num" style="color:green;"> ';echo num('query','start','1'); echo' </strong>个</p>
                <p class="col-md-4"><span class="glyphicon glyphicon-remove-sign" style="color:red;" aria-hidden="true"></span> 已取消任务:<strong class="num" style="color:red;"> '; echo num('query','start','2') ;echo' </strong>个</p>
            </div>
            <div class="khinfo">
                <p class="col-md-4">当前共有 <span class="glyphicon glyphicon-user"></span><span style="color:red">'; echo num('user_info'); echo'</span> 名登记客户</p>
                <p class="col-md-4">当前共有 <span class="glyphicon glyphicon-user"></span><span style="color:red">'; echo num('gys'); echo'</span> 个供应商</p>
                <p class="col-md-4">当前共有 <span style="color:red">'; echo num('config'); echo'</span> 个装机配置</p>
            </div>
            <div class="billinfo">
            <div class="col-md-4"><span><span class="glyphicon glyphicon-shopping-cart" style="color:orange;" aria-hidden="true"></span> 今日消费<strong class="num"> '; echo  num('item_bailu','time',date('Ymd',time())); echo '  </strong>单</span></div>
            <div class="col-md-4"><span><span class="glyphicon glyphicon-ok-sign" style="color:green;" aria-hidden="true"></span> 已确认<strong class="num"> '; echo  num('item_bailu','start','1'); echo '  </strong>单</span></div>
            <div class="col-md-4"><span><span class="glyphicon glyphicon-remove-sign" style="color:red;" aria-hidden="true"></span> 已删除<strong class="num"> '; echo  num('item_bailu','start','2'); echo '  </strong>单</span></div>
            </div>
            ';
        }
        ?>
        </div>
    </div>
</body>
</html>